﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MachiningHelper.ToolFile
{
   public class ConditionChecker
   {
       #region 判断两份加工是否为同片板件加工
       public static bool IsOnePart(MachiningPart partFace5, MachiningPart partFace6)
       {
           if (
               (partFace5.Border.CutPartLength != partFace6.Border.CutPartLength |
               partFace5.Border.CutPartWidth != partFace6.Border.CutPartWidth |
               partFace5.Border.A59 != partFace6.Border.A59 |
               partFace5.Border.Description != partFace6.Border.Description) |
               !(
                   (partFace5.Border.DoubleFace5 & partFace6.Border.DoubleFace6) |
                   (partFace5.Border.DoubleFace6 & partFace6.Border.DoubleFace5)
               )
               )
               return false;
           return true;
       }
       #endregion
       #region 判断两片板件是否能使用Skipper100的双板叠加加工
       public static bool AllowFlipDoubleParts(MachiningPart part1,MachiningPart part2)
       {
           if (part1.Border.PanelLength == part2.Border.PanelLength &
               part1.Border.PanelWidth == part2.Border.PanelWidth &
               part1.Border.PanelThickness == part2.Border.PanelThickness &
               (part1.Border.Face5Only | part1.Border.Face6Only) &
               (part2.Border.Face5Only | part2.Border.Face6Only)
               )
               return true;
           return false;
       }
       #endregion
       #region 判断板件是否为双面加工
       public static bool IsDoubleFaceMachining(MachiningPart part)
       {
           if (part.Border.DoubleFace5 | part.Border.DoubleFace6)
               return true;
           return false;
       }
       #endregion
   }
}
